<?php 
if(isset($ganho)){
	$id = $ganho->id;
	$nome = $ganho->nome;
	$valor = $ganho->valor;
	$data = $ganho->data;
}
?>
<h2>
	<span>Editar ganho</span>
</h2>
<?php echo validation_errors('',''); ?>
<div class="clr"></div>
<?php echo form_open("javascript:gravar();",array("id"=>"formulario"));?>
<?php echo form_hidden("id",$id);?>
<table>
	<tr>
		<td><?php echo form_label("Nome","nome");?>
		</td>
		<td><?php echo form_input(array("name"=>"nome","id"=>"nome","value"=>set_value("nome",$nome)))?>
		</td>
	</tr>
	<tr>
		<td><?php echo form_label("Valor","valor");?>
		</td>
		<td><?php echo form_input(array("name"=>"valor","id"=>"valor","value"=>set_value("valor",$valor)))?>
		</td>
	</tr>
	<tr>
		<td>
			<?php echo form_label("Data","data");?>
		</td>
		<td>
			<?php echo form_input(array("name"=>"data","id"=>"data","readonly"=>"readonly"),set_value("data",$data))?>
		</td>
	</tr>
	<tr>
		<td colspan="2" align="right">
			<?php echo form_button(array("onclick"=>"excluir({$id});"),"Excluir");?>
			<?php echo form_button(array("onclick"=>"gravar();"),"Atualizar");?>
		</td>
	</tr>
</table>
<?php echo form_close();?>